<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
    <link href="https://getbootstrap.com/docs/4.0/examples/signin/signin.css" rel="stylesheet" crossorigin="anonymous"/>
</head>
<body>

<div id="app" class="container">
    <a href="/logout">退出{{msg}}</a>
    <button class="btn btn-info" @click="changeMsg">修改</button>
    <button class="btn btn-info" @click="doGet">发送get请求</button>
    <button class="btn btn-info" @click="doCrossGet">发送跨域get请求</button>
    <h2 class="form-signin-heading">Login with OAuth 2.0</h2>
    <table class="table table-striped">
        <tr>
            <td><a href="/oauth2/authorization/github">GitHub</a></td>
        </tr>
        <tr>
            <td><a href="/oauth2/authorization/myauth">myauth</a></td>
        </tr>
        <tr>
            <td><a href="/oauth2/authorization/gitee">gitee</a></td>
        </tr>
    </table>
</div>


<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.26.0/axios.min.js"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                msg: 'hello vue2.0',
            }
        },
        methods: {
            changeMsg() {
                this.msg = '我修改了msg';
            },
            doGet() {
                // axios.get('http://localhost:6000/test/needAuth')
                axios.get('/user')
                    .then(res => {
                        console.log(res)
                    })
            },
            doCrossGet() {
                axios.get('http://localhost:7000/test/needAuth?access_token=bfb1744c-1561-4b7d-8dad-b2f07e05f097')
                    .then(res => {
                        console.log(res)
                    })
            },
        }
    })
</script>
</body>
</html>
